﻿using NavTabControl;
using System;
using System.Threading;
using System.Windows.Forms;
using WinForm.NET4.Sample.ModuleA;

namespace WinForm.NET4.Sample.ModuleA
{
    public partial class MainForm : UIPage
    {
        public const int SYMBOL_SIZE = 24;

        public MainForm()
        {
            InitializeComponent();

            int pageIndex = 10;

            NavMenu.TabControl = TabContainer;

            TreeNode parent = NavMenu.CreateNode("功能导航", FontAwesomeIcons.fa_th_list, SYMBOL_SIZE, pageIndex);

            NavMenu.CreateChildNode(parent, FontAwesomeIcons.fa_cubes, SYMBOL_SIZE,
                AddPage(++pageIndex, new MAPage1() { Text = "功能1" }));

            NavMenu.CreateChildNode(parent, FontElegantIcons.icon_tools, SYMBOL_SIZE, 
                AddPage(++pageIndex, new MAPage2() { Text = "功能2" }));

           
            NavMenu.SelectFirst();

        }

        private UIPage AddPage(int index, UIPage page)
        {

            TabContainer.AddPage(index, page);

           

            return page;


        }


    }
}